]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensions-app: Add quit action
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 28 Oct 2020 20:42:48 +0000 (21:42 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 28 Oct 2020 20:45:18 +0000 (21:45 +0100)
It's good practice to support the standard <ctrl>-q shortcut, so
add a corresponding action and set its accel accordingly.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3335

subprojects/extensions-app/js/main.js

index aae5b9bfad7073417ef653491db4a9083f8ef86e..2e8b01804bfed0cdc253a311e1a8f9736c389bbe 100644 (file)
@@ -67,6 +67,12 @@ class Application extends Gtk.Application {
             provider,
             Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
 
+        const action = new Gio.SimpleAction({ name: 'quit' });
+        action.connect('activate', () => this._window.close());
+        this.add_action(action);
+
+        this.set_accels_for_action('app.quit', ['<Primary>q']);
+
         this._shellProxy = new GnomeShellProxy(Gio.DBus.session,
             'org.gnome.Shell.Extensions', '/org/gnome/Shell/Extensions');